From: Martin Rudalics Date: Wed, 16 May 2007 05:49:57 +0000 (+0000) Subject: (ispell-start-process): Defend against bad default-directory. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~18871 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=e081ac0c775346c89f795091f98cbbc75bb4600e;p=emacs.git (ispell-start-process): Defend against bad default-directory. --- diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index a3c9575d90c..e4b2dd9f040 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2483,7 +2483,12 @@ When asynchronous processes are not supported, `run' is always returned." (defun ispell-start-process () "Start the ispell process, with support for no asynchronous processes. Keeps argument list for future ispell invocations for no async support." - (let (args) + (let ((default-directory default-directory) + args) + (unless (and (file-directory-p default-directory) + (file-readable-p default-directory)) + ;; Defend against bad `default-directory'. + (setq default-directory (expand-file-name "~/"))) ;; Local dictionary becomes the global dictionary in use. (setq ispell-current-dictionary (or ispell-local-dictionary ispell-dictionary))